<?php
$a = ['张三丰','里  斯','阿 kit','papi 酱','Jackson'];
outFormat(35, $a);
function outFormat(int $width, ?array $a): void {
    if(is_null($a))return;
    foreach($a as $name){
        $name=str_replace(' ','',$name);
        $hex=bin2hex($name);
        $hex=strtoupper($hex);
        $hex=chunk_split($hex,2,"_");
        $hex=substr($hex,0,-1);
        $lenName=strlen(iconv('utf-8','gbk',$name));
        $lenHex=strlen($hex);
        $lenSpace=$width-$lenName-$lenHex;
        if($lenSpace<0)$lenSpace=0;
        echo $name,str_repeat(' ',$lenSpace),$hex,"\n";
    }
}
